<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Search Users</title>
<script language="javascript">
function onCreateUser() {
    document.location.href = "./GoCreateUserServlet";
}
function onDeleteUser() {
    if (confirm("Selected users will be deleted? Are you sure?")) {
        document.ListOfUserForm.action = "./DeleteUserServlet";
        document.ListOfUserForm.submit();
    }
}
</script>
</head>
<body>
    <form name="searchUsers" action="./SearchUserServlet" method="post">
    <table>
        <tr>
            <td colspan="4"><h1>Search user</h1></td>
            <td><a href="./GoAdminFunctionServlet">Main menu</a><td>
            <td><a href="./LogoutServlet">Logout</a></td>
        </tr>
        <tr>
            <td>User name</td>
            <td>
                <input type="text" name="username">
            </td>
            <td width="10%"></td>
            <td>User group</td>
            <td>
                <select name="groupname">
                    <option value="admin">admin</option>
                    <option value="user">user</option>
                </select>
            </td>
        </tr>
         <tr>
            <td>First name</td>
            <td>
                <input type="text" name="firstname">
            </td>
            <td width="10%"></td>
            <td>Last name</td>
            <td>
                <input type="text" name="lastname">
            </td>
        </tr>

        <tr>
            <td>Sex</td>
            <td>
                <input type="text" name="lastname">
            </td>
            <td width="10%"></td>
            <td>Email</td>
            <td>
                <input type="text" name="email">
            </td>
        </tr>
        <tr>
            <td>Address</td>
            <td>
                <input type="text" name="address">
            </td>
            <td width="10%"></td>
            <td>Mobile-phone</td>
            <td>
                <input type="text" name="mobilephone">
                &nbsp; <input type="submit" value="Search">
            </td>
        </tr>
        <tr>
            <td></td>
        </tr>
    </table>
</form>

<h1>The matching list</h1>
<form name="ListOfUserForm" method="post">
    <input type="hidden" name="from" value="searchusers">
    <table width="100%">
            <tr bgcolor="gray" bordercolor="red">
                <td><b>User name</b></td>
                <td><b>Password</b></td>
                <td><b>First name</b></td>
                <td><b>Last name</b></td>
                <td><b>Sex</b></td>
                <td><b>Address</b></td>
                <td><b>Email</b></td>
                <td><b>Mobile-phone</b></td>
                <td><b>Role name</b></td>
                <td></td>
            </tr>

                <tr>
                    <td><a href="./ViewUserServlet?username="></a></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>
                        <input type="checkbox" name="selectedUser" value="">
                    </td>
                </tr>
          
            <tr><td colspan="10" align="right">
                    <input type="button" value="Back" onclick="history.back();">
                    <input type="button" value="Create" onclick="onCreateUser();">
                    <input type="button" value="Delete" onclick="onDeleteUser();">
                <td>
            </tr>
    </table>
</form>


</body>
</html>